package com.action.message;

import com.db.message.*;
import com.opensymphony.xwork2.ActionContext;

import java.util.*;

public class InsertAction {

	private String recv_id;
	private String content;
	private MessageDAO msg;

	public MessageDAO getMsg() {
		return msg;
	}

	public void setMsg(MessageDAO msg) {
		this.msg = msg;
	}

	public void setRecv_id(String recv_id) {
		this.recv_id = recv_id;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String execute() throws Exception {

		MessageVO vo = new MessageVO();

		Map session = ActionContext.getContext().getSession();

		String send_id = (String) session.get("login");

		vo.setRecv_id(recv_id);
		vo.setContent(content);
		vo.setSend_id(send_id);

		msg.msgSend(vo);

		return "success";
	}
}
